﻿@model IEnumerable<Samples.AspNetMvc5.Data.Contact>

@{
    ViewBag.Title = "Contacts";
}

<h2>Contacts</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th scope="col">@Html.DisplayNameFor(model => model.Name)</th>
            <th scope="col">@Html.DisplayNameFor(model => model.EmailAddress)</th>
            <th scope="col"></th>
        </tr>
    </thead>

    <tbody>
    @foreach (var item in Model)
    {
        <tr>
            <th scope="row">@Html.DisplayFor(modelItem => item.Name)</th>
            <td>@Html.DisplayFor(modelItem => item.EmailAddress)</td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Details", "Details", new { id = item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.Id })
            </td>
        </tr>
    }
    </tbody>
</table>
